package com.list.demo;

import com.list.domain.Student;

import java.util.ArrayList;

public class Demo05 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        Student lu = new Student("鹿晗", 31);
        Student guan = new Student("关晓彤", 24);
        Student wu = new Student("吴亦凡", 31);
        Student liu = new Student("刘德华", 31);
        Student zhou = new Student("周星驰", 31);

        list.add(lu);
        list.add(guan);
        list.add(wu);
        list.add(liu);
        list.add(zhou);
        for (int i = 0; i < list.size(); i++) {
            //list.get(i)
            Student student = list.get(i);
            System.out.println(student);
        }
    }
}
